package learn;

import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.web.client.RestTemplate;

import java.nio.charset.Charset;

public class http_test {
    public static void main(String[] args) {
        String url="https://gitee.com/dgut-sai/COVID-19/raw/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv";
        RestTemplate template = new RestTemplate(new HttpComponentsClientHttpRequestFactory());
        template.getMessageConverters().set(1, new StringHttpMessageConverter(Charset.forName("utf-8")));
        String result = template.getForObject(url,String.class);
        System.out.println(result);

    }

}
